/*
 * @Author: sjf 1758142861@qq.com
 * @Date: 2023-03-17 19:24:29
 * @LastEditors: sjf 1758142861@qq.com
 * @LastEditTime: 2023-03-17 19:32:13
 * @FilePath: /D_C_lib/lw_process/day3/mypthread.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include<iostream>
#include<unistd.h>
#include<pthread.h>

using namespace std;

void* __start_routie(void* arg)
{
    const char* name = static_cast<const char*>(arg);
    while(true){
    std::cout << "我是一个新的线程, name:" << name << std::endl;
    sleep(1);}
}

int main()
{
    pthread_t tid;
    pthread_create(&tid,nullptr,__start_routie,(void*)"thread one");
    while(true)
    {
        std::cout << "我是主线程!" << std::endl;
        sleep(1);
    }
    return 0;
}